package SpringFramework.条件注解.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

import SpringFramework.条件注解.conditional.LinuxCondition;
import SpringFramework.条件注解.conditional.WindowsCondition;
import SpringFramework.条件注解.service.ICmd;
import SpringFramework.条件注解.service.LinuxCmdService;
import SpringFramework.条件注解.service.WindowsCmdService;

// @Configuration声明当前类是一个配置类
@Configuration
public class JavaConfig {
	@Bean
	@Conditional(WindowsCondition.class)
	public ICmd windowsCmd() {
		return new WindowsCmdService();
	}


	@Bean
	@Conditional(LinuxCondition.class)
	public ICmd linuxCmd() {
		return new LinuxCmdService();
	}

}
